home *** CD-ROM | disk | FTP | other *** search
/ L' Effet Pommier 3 / L'Effet Pommier - Volume 03.iso / Programmation / Gooey1.3.1 / Docs & Compile Hints / MetroWorks CW5 C++ Hints < prev    next >
Text File  |  1995-02-06  |  6KB  |  194 lines

  1. There is a file named "Metrowerks Setup" in the "C++ Templates folder. Delete the file
  2. named "Setup" in this folder.  Make a copy of the "Metrowerks Setup" file and then
  3. rename this copy to "Setup".
  4.  
  5. This will make sure that the file types of the source code generated is the correct
  6. creator, so Metrowerks will be launched automatically when double-clicking on one
  7. of these files.
  8.  
  9.  
  10.  
  11. After generating code for the first time, for your new prototype, follow this method 
  12. to get Metrowerks CW5 C++ up and working for you:
  13.  
  14. CREATING A PROJECT...
  15.  
  16. Ñ Find the 'Sources" folder made by the Code Generator.
  17. Ñ Open the "Sources" folder.
  18. Ñ Open the "mm" folder inside the "Sources" folder.
  19. Ñ Double click on any of the files you see there, this will automatically launch 
  20.     Metrowerks Project Manager.
  21. Ñ╩Select "New Project╔" from the "File" menu. Use the template for a "Mac C++ App".
  22.     When Metrowerks brings up a save dialog, it is asking you to name the new Metrowerks 
  23.     project you are making.  
  24.     Relocate your new "Sources" folder that the Code Generator made for you.  Open the 
  25.     "Sources" folder. Now enter your project name, using Option-P for the "╣" part of 
  26.     the name, e.g. MyProgram.╣
  27.  
  28. Ñ Close the one file that Metrowerks opened for you.
  29.  
  30. Ñ Select the project window.
  31.  
  32.  
  33.  
  34. ADDING Gooey SPECIFIC FILES...
  35.  
  36. Ñ Select the "main.cp" file. This will define the area to add files into.
  37.  
  38. Ñ Under the "Project" menu, select the "Add File..." menu item.
  39.  
  40. Ñ Open the "mm" folder, from the Add dialog.
  41.  
  42. Ñ Press the "Add all" button, this will select every file in this "mm" dialog.
  43.  
  44. Ñ Press the "Done" button, this will now add them all to your project.
  45.  
  46. Ñ╩Make the project window taller if necessary, for extra empty space at the bottom.
  47.  
  48. Ñ Select the "main.cp" file again.
  49.  
  50. Ñ Select the "Remove files" menu option under the "Project" menu.
  51.  
  52.  
  53.  
  54. ADDING user SPECIFIC FILES...
  55.  
  56. Ñ Under the "Source" menu, select the "Add File..." menu item.
  57.  
  58. Ñ Go up one level, from the "mm" folder into the "Source" folder.
  59.  
  60. Ñ Open the "u" folder, from the Add dialog.
  61.  
  62. Ñ Select the first file only.
  63.  
  64. Ñ Press the "Add" button and then the "Done" button. This adds that one file to the end.
  65.  
  66. Ñ Drag that one file down, this selects a new segment for the next files to go into.
  67.  
  68. Ñ Select that single file, this tells Metrowerks to all all the next files into that 
  69.     same segment.
  70.  
  71. Ñ Under the "Source" menu, select the "Add File..." menu item.
  72.  
  73. Ñ Press the "Add All" button, this will select every file in this "u" dialog.
  74.  
  75. Ñ Press the "Done" button, this will now add them all to your project.
  76.  
  77. Ñ Now go to the top of the project window and select any file in the first segment. 
  78.     This tells it that more files added will go into that segment.
  79.  
  80.  
  81.  
  82. ADDING RESOURCE FILES...
  83.  
  84. Ñ Select the "My Resource.rsrc" file.
  85.  
  86. Ñ Under the "Project" menu, select the "Add File..." menu item.
  87.  
  88. Ñ Go up one level, from the "mm" folder into the "Source" folder.
  89.  
  90. Ñ Open the "resources" folder, from the Add dialog.
  91.  
  92. Ñ Press the "Add All" button, this will select every file in this "u" dialog.
  93.  
  94. Ñ Press the "Done" button, this will now add them all to your project.
  95.  
  96. Ñ Reselect the "My Resource.rsrc" and choose "Remove files" from the "Project" menu.
  97.  
  98.  
  99.  
  100.  
  101. MAKING A precompiled HEADER
  102.  
  103. Ñ Under the "File" menu, select the "Open..." menu item.
  104.  
  105. Ñ Go up one level, from the "resources" folder into the "Source" folder.
  106.  
  107. Ñ Open the "mmHeaders.cp" file.  This is the file that will make the precompiled headers.
  108.  
  109. Ñ Under the "Project" menu select the "Precompile╔" menu item.
  110.  
  111. Ñ When the headers are compiled a Save dialog will say "Save headers as...".  Give the 
  112.     headers the name "mmHeaders". (If doing 68K and PPC then name them "mmHeaders68K" and 
  113.     "mmHeadersPPC").
  114.  
  115. Ñ Close the "mmHeaders.c" file.
  116.  
  117.  
  118.  
  119.  
  120. PREFERENCES
  121.  
  122. Ñ Set all your preferences.
  123.  
  124. Ñ╩Be sure to select the "C++" compiler in the preferences.
  125.  
  126. Ñ In the Language preferences, change the prefix file to be "mmHeaders". (If doing 68K and 
  127.     PPC then name them "mmHeaders68K" and "mmHeadersPPC").
  128.  
  129. Ñ In the Project preferences, change the partition size to something larger, like 1024K.
  130.  
  131. Ñ Change the "SIZE Flags" the flags you want.
  132.  
  133. Ñ Set all other preferences that you want.
  134.  
  135.  
  136.  
  137.  
  138. BUILDING
  139.  
  140. Ñ Under the "Project" menu, select the "Bring Up To Date" menu item. This will compile 
  141.     all the files.
  142.  
  143.  
  144.  
  145.  
  146.  
  147. CODING...
  148.  
  149. Ñ Make your changes to any file that does not start with "mm".  All the other files hook 
  150.     into the "mm" files to provide you with access.
  151.  
  152.  
  153.  
  154. RE-GENERATION.  After making changes or additions to your prototype.
  155.  
  156. Ñ Generate all sources again.  This will make a new folder named "Sources" or  "Sources" 
  157.     with a number after it if that folder alreay exists.
  158.  
  159. Ñ Drag the "mm" folder from the newly generated folder into your working folder. 
  160.     NOTE: This replaces your older "mm" folder.  If you have made changes to any "mm" 
  161.     files, you should never need to, then drag them into another folder first.
  162.  
  163. Ñ Drag the "mmXXX.rsrc" file from the new "resources" folder into your working "resources" 
  164.     folder.
  165.  
  166. Ñ Empty the trash.
  167.  
  168.  
  169. If you added a new Window, Dialog, or Alert then drag that corresponding file from the 
  170.     new "u" folder into your working "u" folder.  If you are asked about replacing a 
  171.     file then say "No", you got the wrong file.
  172.  
  173.  
  174. If you added a menu then open your "menuXXX.h" file and the new "menuXXX.h". Copy over 
  175. the prototype for the new menu.  Open your "menuXXX.c" file and the new "menuXXX.c".  
  176. Copy over the routine for the new menu.
  177.  
  178. If you added a button or other control then let THINK find any additional routines for 
  179. you, in error messages.
  180.  
  181.  
  182.  
  183. Ñ Under the "Project" menu, select the "Remove Binaries" menu item. This will make sure 
  184. that all files will be recompiled. 
  185.  
  186. Ñ Under the "Project" menu, select the "Bring Up To Date" menu item. This will compile 
  187. all the files.
  188.  
  189. If there are errors involving new routines, like a checkbox handler routine where there 
  190. were no check boxes before.  Open the old corresponding "xxx.h" file, from the "u" folder. 
  191. Open the new "xxx.h" file, copy the new prototype over.  Open the "xxx.c" files and copy 
  192. over the new routine.
  193.  
  194.